home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
TEMP
/
GNU
/
bison
/
RpcalcComq
< prev
next >
Wrap
Text File
|
1995-06-28
|
884b
|
46 lines
Rpcalc Compile
Previous: <Rpcalc Gen=>RpcalcGeo> * Next: <Infix Calc=>InfixCalc> * Up: <RPN Calc=>RPNCalc>
#Wrap on
{fH4}Compiling the Parser File{f}
Here is how to compile and run the parser file:
#Wrap off
#fCode
\# List files in current directory.
% ls
rpcalc.tab.c rpcalc.y
\# Compile the Bison parser.
\# {fEmphasis}-lm{f} tells compiler to search math library for {fCode}pow{f}.
% cc rpcalc.tab.c -lm -o rpcalc
\# List files again.
% ls
rpcalc rpcalc.tab.c rpcalc.y
#f
#Wrap on
The file {fCite}rpcalc{f} now contains the executable code. Here is an
example session using {fCode}rpcalc{f}.
#Wrap off
#fCode
% rpcalc
4 9 +
13
3 7 + 3 4 5 \*+-
-13
3 7 + 3 4 5 \* + - n Note the unary minus, {fEmphasis}n{f}
13
5 6 \/ 4 n +
-3.166666667
3 4 ^ Exponentiation
81
^D End-of-file indicator
%
#f
#Wrap on